class Solution {
    public String largestNumber(int[] nums) {
        String[] strs = new String[nums.length];
        for (int i = 0; i < nums.length; i++)
            strs[i] = nums[i] + "";
        Arrays.sort(strs, (o1, o2) -> (o2 + o1).compareTo(o1 + o2));
        StringBuffer sb = new StringBuffer();
        for (String str : strs)
            sb.append(str);
        if (sb.charAt(0) == '0')
            return "0";
        return sb.toString();
    }
}